Skip to content

fix(stackblitz): bootstrap pnpm 10 in WebContainer start command#464

Merged
os-zhuang merged 1 commit into
mainfrom
fix/stackblitz-pnpm10
Jul 22, 2026
Merged

fix(stackblitz): bootstrap pnpm 10 in WebContainer start command#464
os-zhuang merged 1 commit into
mainfrom
fix/stackblitz-pnpm10

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Problem

The Open in StackBlitz flow dies on pnpm install:

ERR_PNPM_UNSUPPORTED_ENGINE  Unsupported environment (bad pnpm and/or Node.js version)
Expected version: >=10.0.0
Got: 8.15.6

StackBlitz WebContainers ship a pinned pnpm 8.15.6, which:

  • fails the repo's engines.pnpm: ">=10.0.0" gate under engine-strict=true (.npmrc), and
  • cannot read pnpm-lock.yaml (lockfileVersion 9.0, which needs pnpm 9+/10).

Relaxing the engine check is the wrong fix — pnpm 8 still can't parse the v9 lockfile. StackBlitz genuinely needs pnpm 10. The error only flags pnpm (not Node), so the WebContainer's Node already satisfies >=22.

Fix

Prepend npm i -g pnpm@10.33.0 (matching the packageManager field) to .stackblitzrc's startCommand, so the WebContainer installs a compatible pnpm before install/dev. Also upgrades the global pnpm, so a manual pnpm install && pnpm dev in the StackBlitz terminal works too.

- "startCommand": "pnpm install && pnpm dev",
+ "startCommand": "npm i -g pnpm@10.33.0 && pnpm install && pnpm dev",

Keeps engine-strict and the Node 22 / pnpm 10 requirements intact for real dev + CI. Config-only — does not touch the publishable dist/objectstack.json.

Verification

  • pnpm verify green locally (validate ✓, typecheck ✓, build ✓, test 17/17 ✓).
  • v9 lockfile resolves cleanly under pnpm 10.33.0 (Lockfile is up to date).
  • .stackblitzrc is valid JSON.

Maintenance note: the pinned version is coupled to packageManager — bump both together on a future pnpm upgrade.

🤖 Generated with Claude Code

StackBlitz WebContainers ship a pinned pnpm 8.15.6, which fails the
repo's `engines.pnpm >=10.0.0` gate under `engine-strict=true` and
cannot read the lockfileVersion 9.0 pnpm-lock.yaml. The "Open in
StackBlitz" flow therefore died on `pnpm install` with
ERR_PNPM_UNSUPPORTED_ENGINE.

Prepend `npm i -g pnpm@10.33.0` (matching the `packageManager` field)
to the startCommand so the WebContainer installs a compatible pnpm
before install/dev. Keeps engine-strict and the Node 22 / pnpm 10
requirements intact for real dev + CI. Config-only; does not affect
the publishable dist/objectstack.json.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@os-zhuang
os-zhuang merged commit e16291e into main Jul 22, 2026
4 checks passed
@os-zhuang
os-zhuang deleted the fix/stackblitz-pnpm10 branch July 22, 2026 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant